#!/usr/bin/env groovy
// 镜像仓库地址需要时打开
// 使用需要下载pipline
def registry = "xxx"
def project = "max"
def app_name = "java-demo"
def image_name_java = "springboot"
def image_name_node = "node"
def git_address = "https://gitee.com/Jahon/cont8.git"
pipeline {
    agent any
    stages {
        stage('拉取代码'){
            steps {
            
             checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'Crazyorchid', url: 'https://gitee.com/Jahon/cont8.git']]])
            // 拉取代码
            }
        }

        stage('Build'){
           steps {
             sh """
                pwd
                ls
                cd server
                mvn clean package -Dmaven.test.skip=true -U -T 8
                """
           }
        }

        stage('Test'){
           steps {
             sh """
                cd server
                mvn test
                """
           }
        }
    }
}